package de.mhu.mandalaui.attributes;

import java.io.PrintWriter;

import de.mhu.mandalaui.bind.DataRow;

public class ArrayAttribute extends Attribute {

	@Override
	public void renderFunctionImplementation(PrintWriter out) {
		out.print("ko.observableArray()");
	}

	public void renderRemoveAll(PrintWriter out) {
		renderAttributeName(out);
		out.println(".removeAll();");
	}

	public void renderAppendData(PrintWriter out,DataRow row) {
		renderAttributeName(out);
		out.println(".push(" + row.toJSONString() + ");");
	}

}
